#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_NODES 1000 // 最大节点数量

// 哈夫曼树的节点结构
typedef struct HuffmanNode
{
    int freq;                 
    struct HuffmanNode *left;  // 左子节点
    struct HuffmanNode *right; // 右子节点
} HuffmanNode;

// 最小堆的结构
typedef struct MinHeap
{
    HuffmanNode *data[MAX_NODES];
    int size;
} MinHeap;

// 创建一个哈夫曼节点
HuffmanNode *create_node(int freq)
{
    HuffmanNode *node = (HuffmanNode *)malloc(sizeof(HuffmanNode));
    node->freq = freq;
    node->left = node->right = NULL;
    return node;
}

// 初始化最小堆
MinHeap *create_min_heap(){
    MinHeap *heap = (MinHeap *)malloc(sizeoff(MinHeap));
    heap->size = 0;
    return heap;
}

// 交换两个堆节点
void swap(HuffmanNode **a,HuffmanNode **b){
    
}